import request from '@/utils/request_1'

// 新增入库清单
export const addWarehouseInList = (params: any) =>
  request({
    url: '/receiptList',
    method: 'post',
    data: { ...params }
  })

// 修改入库清单
export const updateWarehouseInList = (params: any) =>
  request({
    url: '/receiptList',
    method: 'put',
    data: { ...params }
  })

// 删除入库清单
export const deleteWarehouseInList = (params: any) =>
  request({
    url: '/receiptList',
    method: 'delete',
    params
  })

// 批量新增入库清单
export const batchAddWarehouseInList = (params: any) =>
  request({
    url: '/receiptList/batch',
    method: 'post',
    data: { ...params }
  })

// 查询全部入库清单
export const findWarehouseInList = (params: any) =>
  request({
    url: '/receiptList/list',
    method: 'get',
    params
  })

// 分页查询入库清单
export const findWarehouseInListPaging = (params: any) =>
  request({
    url: '/receiptList/page',
    method: 'get',
    params
  })

// 分页查询入库清单明细
export const findWarehouseInListDetailPaging = (params: any) =>
  request({
    url: '/receiptList/pageDetail',
    method: 'get',
    params
  })

// 查询入库清单
export const findOneWarehouseInList = (id: string) =>
  request({
    url: `/receiptList/${id}`,
    method: 'get'
  })

// 查询合计信息
export const findSumWarehouseInList = (masterId: any) =>
  request({
    url: `/receiptList/sum/${masterId}`,
    method: 'get'
  })

// 查询入库清单关联的商品id集合
export const findSelectedWarehouseInList = (params: any) =>
  request({
    url: '/receiptList/goodsIds',
    method: 'get',
    params
  })

// 根据masterId删除清单
export const deleteWarehouseInListByMasterId = (params: any) =>
  request({
    url: '/receiptList/masterId',
    method: 'delete',
    params
  })
